Describe required version of Node.js and NPM.#302
Conversation
Yes, we don't want this, and we should set the version |
|
@adamretter as I have told you before you opened the issue, the next release of monex (targeting exist 7) will have a node version of |
|
@adamretter yes I can confirm that it works on both v20 and v22.16.0 |
|
@marmoure Okay, I have now appended a commit to document Node.js 22 as the required version. |
marmoure
left a comment
There was a problem hiding this comment.
@adamretter Great , the versions in the range should work without any issues.
@duncdrum the PR is changed accordingly, LGTM |
|
@reinhapa Would you mind also reviewing and approving if you are happy with it please? |
duncdrum
left a comment
There was a problem hiding this comment.
@adamretter adding a node engine declaration to package.json that is not identical to the one in pom.xml increases the maintenance burden and introduces ambiguities.
Monex is not a node package, it is a pure consumer of node dependencies which are resolved and managed by maven. Any conflicts will appear as part of the maven build.
If we declare a compatibility with node 18.x we would need to test it, which this PR doesn't. Doing so would just increase overhead, for no benefit. The only node version of relevance is the one set in pom.xml.
If there is a scenario where the engine object would actually be helpful please let us know. Otherwise just take it out, and the PR is good to go.
|
@duncdrum Thank you for the followup.
Unfortunately, unless you want to set a single specific version of Node.js and NPM in the
Yes, that is already clear to us. This PR is NOT about building a Node package from Monex.
Prior to this PR you already had that explicitly, as
For users who already have a global Node.js and NPM (as many of us do), being able to correctly use local Node tools, without first having to spend time to divine which versions are required to work with Monex (without I hope this detailed explanation with links to docs and specs has now made the value of its changes clear. If you have any further questions please let us know... |
The |
|
@adamretter yes both serve a different purpose. Here we only need the node version for building with maven. Thus, only the setting in the pom is relevant. |
What about when you want to manage and update Node.js dependencies with npm @line-o? You can't do that from Maven at the moment! |
|
@adamretter you do so from the node version that is specified in the pom, as this is the node version required by the build. |
|
@duncdrum in practice that doesn't work, without the engine setting, you have no idea what version of node is required to perform tasks with Node (outside of Maven), e.g. finding compatible Node Module version updates |
|
Dependabot does not care about the stated node versions. Which external tooling do you have in mind @adamretter? |
|
@duncdrum @line-o Here is a concrete example from today of why this PR is important:
The issue is that the way to run |
@line-o Sorry, perhaps I wasn't very clear. I wasn't talking about Dependabot there. I was talking about |
One of the problems with JavaScript projects is when they don't document or enforce which version of Node.js or NPM is required to build them; without that it becomes a game of guessing and/or whack-a-mole.
This sets the version of Node.js and NPM in package.json to the same as that which was previously specified in the
pom.xml- https://github.com/eXist-db/monex/blob/master/pom.xml#L58The existing required version is of course very old. If it is possible to successfully build Monex with a newer version of Node.js and NPM, then I would suggest either: